<?php
  $path = drupal_get_path('module', 'service');
  drupal_add_css($path . '/css/service.css');
  drupal_add_js($path . '/js/service.js');

function services_dept_pro_data($nid,$orgid) {
global $language,$base_url,$user;
 $url = $base_url . '/' . drupal_get_path('module', 'service');

  my_db_change(1);
  $nid = arg(2);
  $orgid =arg(3);

  my_db_change(1);
  $vid = db_query('SELECT vid FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchField();
  $nodedata = node_load($nid, $vid);
  my_db_change(0);
/*
$lanid = 'nid';
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', 'service_registration')
  ->fieldCondition('field_src_org', 'value', $orgid, '=')
 // ->fieldCondition('field_scr_desc', 'value')
  ->propertyCondition('status',1)
  ->propertyCondition($lanid,$nid,'=');
//->propertyCondition('language', array($GLOBALS['language']->language, LANGUAGE_NONE), 'IN');

$result = $query->execute();
//echo "<pre>result: ";  var_dump($result);  echo "</pre>";

$nid = current($result['node']);

if (isset($result['node'])) {
  $news_items_nids = array_keys($result['node']);
  $node_data = node_load($news_items_nids);
  $vid = $node_data->vid;
  $news_items = entity_load('node', $news_items_nids, array('vid' => $vid));
}
//print "<pre>";print_r($news_items);print "</pre>";
my_db_change(0);
*/
$output = theme('service_dep_pro_org_theme',array('items' => $nodedata,'orgid'=>$orgid,'nid'=>$nid));
return $output;


}